<?php
/**
 *  View Interface
 *
 */
abstract class Yz_View_Abstract
    extends Yz_Class
    implements Yz_View_Interface
{

    /**
     *  @var string
     */
    protected $text = '';


    /**
     *
     *
     */
    public function __construct()
    {
        debug();
    }

    /**
     *  usually called by the response object which is supplied as argument
     *      in order to be notified by the view (set headers, status etc)
     *  @param Yz_HTTP_Response_Interface $rs
     *  @return string
     */
    public function render(Yz_HTTP_Response_Interface $rs)
    {
        return $this->getContent();
    }

    /** get the text (string) content of the view
     *  @return string
     */
    public function getContent()
    {
        return $this->text;
    }

    /** set the text (string) content of the view
     *  @param string $text
     *  @return chainable
     */
    public function setContent( $text )
    {
        $this->text = Yz_String::test($text);
        return $this;
    }

} // class
